package com.ruoyi.pos.domain.system;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * POS柜组信息对象 pos_group
 * 
 * @author ruoyi
 * @date 2025-01-30
 */
public class PosGroup extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 柜组ID */
    private Long groupId;

    /** 柜组编码 */
    @Excel(name = "柜组编码")
    private String groupCode;

    /** 柜组名称 */
    @Excel(name = "柜组名称")
    private String groupName;

    /** 父级柜组ID */
    @Excel(name = "父级柜组ID")
    private Long parentId;

    /** 柜组类型（1-销售柜组 2-服务柜组 3-管理柜组） */
    @Excel(name = "柜组类型", readConverterExp = "1=销售柜组,2=服务柜组,3=管理柜组")
    private String groupType;

    /** 柜组级别 */
    @Excel(name = "柜组级别")
    private Integer groupLevel;

    /** 排序号 */
    @Excel(name = "排序号")
    private Integer sortOrder;

    /** 负责人 */
    @Excel(name = "负责人")
    private String manager;

    /** 联系电话 */
    @Excel(name = "联系电话")
    private String phone;

    /** 柜组地址 */
    @Excel(name = "柜组地址")
    private String address;

    /** 营业时间开始 */
    @JsonFormat(pattern = "HH:mm:ss")
    @Excel(name = "营业时间开始", width = 30, dateFormat = "HH:mm:ss")
    private Date businessStartTime;

    /** 营业时间结束 */
    @JsonFormat(pattern = "HH:mm:ss")
    @Excel(name = "营业时间结束", width = 30, dateFormat = "HH:mm:ss")
    private Date businessEndTime;

    /** 是否24小时营业 */
    @Excel(name = "是否24小时营业")
    private String is24Hours;

    /** 最低销售额 */
    @Excel(name = "最低销售额")
    private BigDecimal minSalesAmount;

    /** 最高销售额 */
    @Excel(name = "最高销售额")
    private BigDecimal maxSalesAmount;

    /** 折扣权限 */
    @Excel(name = "折扣权限")
    private String discountPermission;

    /** 最大折扣率 */
    @Excel(name = "最大折扣率")
    private BigDecimal maxDiscountRate;

    /** 退货权限 */
    @Excel(name = "退货权限")
    private String refundPermission;

    /** 退货天数限制 */
    @Excel(name = "退货天数限制")
    private Integer refundDaysLimit;

    /** 状态（0正常 1停用） */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    public void setGroupId(Long groupId) 
    {
        this.groupId = groupId;
    }

    public Long getGroupId() 
    {
        return groupId;
    }
    public void setGroupCode(String groupCode) 
    {
        this.groupCode = groupCode;
    }

    public String getGroupCode() 
    {
        return groupCode;
    }
    public void setGroupName(String groupName) 
    {
        this.groupName = groupName;
    }

    public String getGroupName() 
    {
        return groupName;
    }
    public void setParentId(Long parentId) 
    {
        this.parentId = parentId;
    }

    public Long getParentId() 
    {
        return parentId;
    }
    public void setGroupType(String groupType) 
    {
        this.groupType = groupType;
    }

    public String getGroupType() 
    {
        return groupType;
    }
    public void setGroupLevel(Integer groupLevel) 
    {
        this.groupLevel = groupLevel;
    }

    public Integer getGroupLevel() 
    {
        return groupLevel;
    }
    public void setSortOrder(Integer sortOrder) 
    {
        this.sortOrder = sortOrder;
    }

    public Integer getSortOrder() 
    {
        return sortOrder;
    }
    public void setManager(String manager) 
    {
        this.manager = manager;
    }

    public String getManager() 
    {
        return manager;
    }
    public void setPhone(String phone) 
    {
        this.phone = phone;
    }

    public String getPhone() 
    {
        return phone;
    }
    public void setAddress(String address) 
    {
        this.address = address;
    }

    public String getAddress() 
    {
        return address;
    }
    public void setBusinessStartTime(Date businessStartTime) 
    {
        this.businessStartTime = businessStartTime;
    }

    public Date getBusinessStartTime() 
    {
        return businessStartTime;
    }
    public void setBusinessEndTime(Date businessEndTime) 
    {
        this.businessEndTime = businessEndTime;
    }

    public Date getBusinessEndTime() 
    {
        return businessEndTime;
    }
    public void setIs24Hours(String is24Hours) 
    {
        this.is24Hours = is24Hours;
    }

    public String getIs24Hours() 
    {
        return is24Hours;
    }
    public void setMinSalesAmount(BigDecimal minSalesAmount) 
    {
        this.minSalesAmount = minSalesAmount;
    }

    public BigDecimal getMinSalesAmount() 
    {
        return minSalesAmount;
    }
    public void setMaxSalesAmount(BigDecimal maxSalesAmount) 
    {
        this.maxSalesAmount = maxSalesAmount;
    }

    public BigDecimal getMaxSalesAmount() 
    {
        return maxSalesAmount;
    }
    public void setDiscountPermission(String discountPermission) 
    {
        this.discountPermission = discountPermission;
    }

    public String getDiscountPermission() 
    {
        return discountPermission;
    }
    public void setMaxDiscountRate(BigDecimal maxDiscountRate) 
    {
        this.maxDiscountRate = maxDiscountRate;
    }

    public BigDecimal getMaxDiscountRate() 
    {
        return maxDiscountRate;
    }
    public void setRefundPermission(String refundPermission) 
    {
        this.refundPermission = refundPermission;
    }

    public String getRefundPermission() 
    {
        return refundPermission;
    }
    public void setRefundDaysLimit(Integer refundDaysLimit) 
    {
        this.refundDaysLimit = refundDaysLimit;
    }

    public Integer getRefundDaysLimit() 
    {
        return refundDaysLimit;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    /**
     * 判断是否为销售柜组
     */
    public boolean isSalesGroup() {
        return "1".equals(this.groupType);
    }

    /**
     * 判断是否为服务柜组
     */
    public boolean isServiceGroup() {
        return "2".equals(this.groupType);
    }

    /**
     * 判断是否为管理柜组
     */
    public boolean isManagementGroup() {
        return "3".equals(this.groupType);
    }

    /**
     * 判断是否24小时营业
     */
    public boolean is24HoursBusiness() {
        return "Y".equals(this.is24Hours);
    }

    /**
     * 判断是否有折扣权限
     */
    public boolean hasDiscountPermission() {
        return "Y".equals(this.discountPermission);
    }

    /**
     * 判断是否有退货权限
     */
    public boolean hasRefundPermission() {
        return "Y".equals(this.refundPermission);
    }

    /**
     * 判断柜组是否正常状态
     */
    public boolean isNormalStatus() {
        return "0".equals(this.status);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("groupId", getGroupId())
            .append("groupCode", getGroupCode())
            .append("groupName", getGroupName())
            .append("parentId", getParentId())
            .append("groupType", getGroupType())
            .append("groupLevel", getGroupLevel())
            .append("sortOrder", getSortOrder())
            .append("manager", getManager())
            .append("phone", getPhone())
            .append("address", getAddress())
            .append("businessStartTime", getBusinessStartTime())
            .append("businessEndTime", getBusinessEndTime())
            .append("is24Hours", getIs24Hours())
            .append("minSalesAmount", getMinSalesAmount())
            .append("maxSalesAmount", getMaxSalesAmount())
            .append("discountPermission", getDiscountPermission())
            .append("maxDiscountRate", getMaxDiscountRate())
            .append("refundPermission", getRefundPermission())
            .append("refundDaysLimit", getRefundDaysLimit())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }

    // ==================== 备用扩展字段 ====================
    
    /**
     * 备用字段1
     */
    private String reserved1;

    /**
     * 备用字段2
     */
    private String reserved2;

    /**
     * 备用字段3
     */
    private String reserved3;

    /**
     * 备用字段4
     */
    private String reserved4;

    /**
     * 备用字段5
     */
    private String reserved5;
}
